package com.ptswitch.material.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.ptswitch.material.model.common.LoginInfo;

public interface LoginInfoMapper {
    @Select("select * from loginInfo where id=#{id}")
    LoginInfo findById(long id);

    @Select("select * from loginInfo where username=#{username}")
    LoginInfo findByUsername(String username);

    @Delete("delete loginInfo where username=#{username}")
    void deleteByUsername(String username);

    @Insert("insert into loginInfo(username) values(#{li.username})")
    void add(@Param("li") LoginInfo loginInfo);

    @Delete("delete from loginInfo where id=#{li.id}")
    void delete(@Param("li") LoginInfo loginInfo);
}
